
import User from './User';

export default class XiaoMing extends User{

    constructor(name, age, sex, major) {
        if(arguments.length === 4){
            super(name, age, sex);
            this.name = name;
            this.age = age;
            this.sex = sex;
            this.major = major;
        }else {
            super('小明', 22, '男');
            this.major = name;
        }

    }

    getDesc(){
        return '名字：'+this.name+'    专业：'+this.major;
    }

}